package com.hinnotek.amoeba.repo

import com.hinnotek.amoeba.api.ApiService
import com.hinnotek.amoeba.base.BaseBean
import com.hinnotek.amoeba.bean.old.CompanyPersonCostPageBean
import com.hinnotek.amoeba.bean.old.CompanyContractByIdBean
import com.hinnotek.amoeba.bean.old.LaborCostDetailBean
import com.lee.common.base.BaseRepository
import com.lee.common.network.net.StateLiveData
import javax.inject.Inject

class PersonRepo @Inject constructor(private val service: ApiService) : BaseRepository() {

    /**
     * app端获取合同列表分页接口
     */
    suspend fun addCompanyPersonCost(
        companyPersonCostType: Int,
        orgId: Int,
        orgName: String,
        customerId: Int,
        customerName: String,
        amibaCustomerProjectId: Int,
        projectName: String,
        amibaProjectId: Int,
        provideProjectName: String,
        personMoney: String,
        createUser: String,
        companyPersonJson: String,
        stateLiveData: StateLiveData<BaseBean>
    ) {
        executeResp({
            service.addCompanyPersonCost(
                companyPersonCostType,
                orgId,
                orgName,
                customerId,
                customerName,
                amibaCustomerProjectId,
                projectName,
                amibaProjectId,
                provideProjectName,
                personMoney,
                createUser,
                companyPersonJson
            )
        }, stateLiveData)
    }

    /**
     * app端获取全部成本记录分页接口
     */
    suspend fun getCompanyPersonCostById(
        companyPersonCostId: Int,
        stateLiveData: StateLiveData<LaborCostDetailBean>
    ) {
        executeResp({ service.getCompanyPersonCostById(companyPersonCostId) }, stateLiveData)
    }

    suspend fun getCompanyPersonCostPage(
        pageNo: Int,
        pageSize: Int,
        stateLiveData: StateLiveData<MutableList<CompanyPersonCostPageBean>>
    ) {
        executeResp({ service.getCompanyPersonCostPage(pageNo, pageSize)}, stateLiveData)
    }

    //CompanyPersonCostPageBean

}